home *** CD-ROM | disk | FTP | other *** search
- //-------------------------------------------------------------------//
-
- // Synopsis: Matrix sign decomposition.
-
- // Syntax: SL = signm ( A )
-
- // Description:
-
- // SL is a list containig elements S and N. SL contains the
- // matrix sign decomposition A = S*N, computed via the Schur
- // decomposition. S is the matrix sign function, sign(A).
-
- // Reference:
- // N.J. Higham, The matrix sign decomposition and its relation to
- // the polar decomposition, Numerical Analysis Report No. 225,
- // University of Manchester, England, April 1993;
- // to appear in Linear Algebra and Appl.
-
- // This file is a translation of signm.m from version 2.0 of
- // "The Test Matrix Toolbox for Matlab", described in Numerical
- // Analysis Report No. 237, December 1993, by N. J. Higham.
-
- // Dependencies
- require matsignt
-
- //-------------------------------------------------------------------//
-
- signm = function ( A )
- {
- local (N, S, t)
-
- t = schur (A+zeros(size(A))*1j);
- S = t.z * matsignt(t.t) * t.z';
-
- // Only problem with Schur method is possible nonzero
- // imaginary part when A is real.
- // Next line takes care of that.
-
- if (!norm(imag(A),"1")) { S = real(S); }
-
- N = S*A;
-
- return << S = S; N = N >>;
- };
-